package lk.icta.common.dao;

import lk.icta.common.entity.District;
import lk.icta.user.entity.User;

import java.util.List;
import java.util.Map;

/**
 * @author Supun Nimesh Karunathilaka
 * @author Duminda Dharmakeerthi
 */
public interface DistrictDAO {
    /**
     * Add a district
     *
     * @param district the district to be added
     * @param user     user performing the action
     */
    public void addDistrict(District district, User user);

    /**
     * Update a district - ie only activate or inactivate
     *
     * @param district the district to be updated
     * @param user     user performing the action
     */
    public void updateDistrict(District district, User user);

    /**
     * Returns the list of Districts for the given language
     *
     * @param language the language ID (see AppConstants)
     * @return a Map of known districts for the given language
     */
    public Map<Integer, String> getDistrictNames(String language, User user);

    /**
     * Returns All Districts
     *
     * @param language the selected language
     * @param user     the user requesting the full District name list
     * @return a Map of all Districts for the given language along with the province ID
     */

    public Map<Integer, String> getAllDistrictNamesByProvinceId(int provinceId, String language, User user);

    /**
     * Returns All Districts
     *
     * @param language the selected language
     * @param user     the user requesting the full District name list
     * @return a Map of all Districts for the given language
     */
    public Map<Integer, String> getAllDistrictNames(String language, User user);

    /**
     * Return the name of the district in the selected language
     *
     * @param districtUKey the district unique key
     * @param language     the selected language
     * @return the name of the district in the selected language along with the key
     */
    public String getNameByPK(int districtUKey, String language);


    /**
     * Return District by district code
     *
     * @param districtId the District code
     * @return District  corresponding to the district code
     */
    public District getDistrictByCode(int districtId);

    /**
     * Return all Districts in the system
     *
     * @return all Districts
     */
    public List<District> findAll();

    /**
     * Find District by  Id
     *
     * @param id The District Id
     * @return A District corresponding to the given id
     */
    public District getDistrictById(int id);


    List<District> getAllDistricts();

}
